/**
 * @title: AuthorityRuleDao
 * @projectName mscloud
 * @Description TODO
 * @Author
 * @Date 2022/2/21 14:03
 */
package com.atguigu.springcloud.cloudsentinelgatewaydevelop.mapper;

import com.atguigu.springcloud.cloudsentinelgatewaydevelop.bean.dto.SentinelAuthorityRuleDTO;
import org.springframework.data.r2dbc.repository.Modifying;
import org.springframework.data.r2dbc.repository.Query;
import org.springframework.data.repository.reactive.ReactiveCrudRepository;
import reactor.core.publisher.Mono;


public interface AuthorityRuleMapper extends ReactiveCrudRepository<SentinelAuthorityRuleDTO, Long> {

    @Modifying
    @Query("delete from sentinel_authority_rule sar where sar.id = :id")
    Mono<Integer> deleteByID(Long id);

    @Modifying
    @Query("delete from sentinel_authority_rule sar where sar.application_name = :applicationName")
    Mono<Integer> deleteByAyApplicationName(String applicationName);


}
